package main

import (
	"fmt"
	"time"
)

func main() {
	// 获取当前时间
	now := time.Now()
	fmt.Println("Current time:", now)

	// 格式化日期和时间
	fmt.Println("Formatted time:", now.Format("2006-01-02 15:04:05"))

	// 计算时间差
	past := time.Date(2009, 11, 10, 23, 0, 0, 0, time.UTC)
	duration := now.Sub(past)
	fmt.Println("Duration since past:", duration)
}
